<section class="content-header">
	<h1>配置管理</h1>
	<ol class="breadcrumb">
		<li><a href="${basePath}"><i class="fa fa-dashboard"></i> 首页</a></li>
		<li><a href="#">服务管理</a></li>
		<li class="active">配置管理</li>
	</ol>
</section>
<section class="content" style="padding: 10px;">

<div class="box box-default">
		<div class="box-header with-border">
			<h3 class="box-title">修改基础配置</h3>

		</div>
		<form id="rule-form" name="rule-form" class="form-horizontal" method="post" >
		
		<div class="box-body">
			<div class="col-md-12">
				
				<div class="form-group" th:each="c : ${config}" >
					<label th:for="${c.ckey}" class="col-sm-3 control-label" th:text="${c.cname}" ></label>
					<div class="col-sm-8">
						<input type="text" class="form-control" required th:id="${c.ckey}" th:name="${c.ckey}" th:placeholder="${c.cname}" th:value="${c.cvalue}">
					</div>
				</div>
				
				
				
			</div>
			
		</div>
		<!-- /.box-body -->
		<div class="box-footer ">
			<!--以下两种方式提交验证,根据所需选择-->
			<button type="reset" class="btn btn-default" >重置</button>
			<button type="submit" class="btn btn-primary pull-right" data-btn-type="save">提交</button>
		</div>
		<!-- /.box-footer -->
	</form>

	</div>



</section>

<script>
$(function() {
	//初始化控件
	form=$("#rule-form").form({baseEntity:false});
	//数据校验
	$("#rule-form").bootstrapValidator({
		message : '请输入有效值',
		feedbackIcons : {
			valid : 'glyphicon glyphicon-ok',
			invalid : 'glyphicon glyphicon-remove',
			validating : 'glyphicon glyphicon-refresh'
		},
		submitHandler : function(validator, userform, submitButton) {
			modals.confirm('确认提交？', function() {
				//Save Data，对应'submit-提交'
				var params = form.getFormSimpleData();
				console.log(params);
				doRequest({
					url : context+'/config/update',
					type:'POST',
					async:false,
					data:params
				}, function(data) {
					
					alalert.succ("提交成功");
					
				});
				
			});
		}
	});
	form.initComponent();
	
});
</script>
